repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
10000 - Longest Paths (Grafos, BFS, Dijkstra)
[andmenj-acm.git]
/
10482 - The candyman can
/
10482.cpp
blob
656a0acb1e637949125967a05f98ed07a69efef6
1
#include <iostream>
2
3
using namespace
std
;
4
5
6
void
printBinary
(
const int
&
x
){
7
unsigned
mask
=
0x80000000
;
8
while
(
mask
){
9
cout
<< ((
x
&
mask
)?
1
:
0
);
10
mask
>>=
1
;
11
}
12
cout
<<
endl
;
13
}
14
15
int
main
(){
16
unsigned
x
;
17
for
(
int
i
=
0
;
i
<=
32
; ++
i
){
18
x
=
1
<<
i
;
19
printf
(
"%u
\n
"
,
x
);
20
//printf("%X\n", x);
21
printBinary
(
x
);
22
}
23
return
0
;
24
}